package com.example;

import com.example.config.RuoYiConfig;
import com.example.domain.SysUser;
import com.example.utils.annotation.Excel;
import com.example.utils.poi.ExcelUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.xml.crypto.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@SpringBootApplication
public class ExcelDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(ExcelDemoApplication.class, args);


        List<SysUser> sysUserList=new ArrayList<>();
        SysUser sysUser=new SysUser();
        sysUser.setUserId(1L);
        sysUser.setNickName("笑笑");
        Date date=new Date();
        date.setTime(2020-1-1);
        sysUser.setBirthday(date);
        sysUser.setPhonenumber("13233333333");
        sysUser.setSex("1");
        sysUserList.add(sysUser);

        SysUser sysUser1=new SysUser();
        sysUser1.setUserId(1L);
        sysUser1.setNickName("笑笑");
        Date date1=new Date();
        date.setTime(2020-1-1);
        sysUser1.setBirthday(date);
        sysUser1.setPhonenumber("13233333333");
        sysUser1.setSex("1");
        sysUserList.add(sysUser);

        SysUser sysUser2=new SysUser();
        sysUser2.setUserId(1L);
        sysUser2.setNickName("笑笑");
        Date date2=new Date();
        date.setTime(2020-1-1);
        sysUser2.setBirthday(date);
        sysUser2.setPhonenumber("13233333333");
        sysUser2.setSex("1");
        sysUserList.add(sysUser);

        RuoYiConfig ruoYiConfig=new RuoYiConfig();
        ruoYiConfig.setProfile("E:\\");
        RuoYiConfig.getDownloadPath();

        ExcelUtil<SysUser> excelUtil=new ExcelUtil(SysUser.class);
       excelUtil.exportExcel(sysUserList, "表1");

    }


}
